const addStorage = (key, obj) => {
    localStorage.setItem(key, JSON.stringify(obj))
}

const getStorage = (key) => {
    return JSON.parse(localStorage.getItem(key) || '{}')
}

const removeStorage = (key) => {
    localStorage.removeItem(key)
}


const USER_KEY = 'USER_KEY'

export default{
    addUserStorage(obj) {
        addStorage(USER_KEY, obj)
    },
    getUserStorage(){
        return getStorage(USER_KEY)
    },
    removeUserStorage(){
        removeStorage(USER_KEY)
    }
}